This invention relates to electronic test and measurement instruments and more particularly to such instruments which are programmable. Even more particularly, this invention relates to a method for extending a programming language used in such instruments.
Electronic test and measurement instruments are becoming more sophisticated each year. Many can now be programmed to produce a sequence of outputs or measurements, and most of these programmable instruments can be connected to other instruments through an electrical interface that allows the instrument to be programmed remotely. One of the most common of these interfaces is defined by the ANSI/IEEE Standard 488, which allows remote programming as well as transferring data from the instrument to a controller for analysis.
The ANSI/IEEE Standard 488 consists of two standards--ANSI/IEEE Standard 488.1 which defines the electrical characteristics of the bus and the communication protocols necessary to effect data exchange; and ANSI/IEEE Standard 488.2 which extends the 488.1 standard by defining standard message handling protocols, message syntax, common commands, status reporting structures and system configuration and synchronization protocols.
One of the provisions of the ANSI/IEEE 488.2 standard is the use of hierarchical languages in defining commands that are acceptable to the programmable instruments. The hierarchical language allowed by IEEE/ANSI 488.2 provides for a compound header that allows multiple mnemonics, separated by the colon (:) character. The description of this language may be specified by a parse tree, for example, the following parse tree represents a simple hierarchical language: ##STR1## where a typical compound command header might be specified as AAA:CCC:DDD, where AAA, CCC, and DDD are mnemonics of the language. A complete instrument command consists of a header followed by zero or more parameters, where a parameter is typically a number. To be complete, a header must specify a mnemonic at each level of the parse tree. For example, AAA:CCC:EEE is complete, whereas AAA:CCC is incomplete, and therefore invalid.
A problem arises if the language needs to be extended by adding new commands, such as might occur with the release of a new version of an instrument, or with the introduction of a new instrument that will perform similar operations. A way is needed to provide an extension of the language which will not affect programs already written for the older version of the same language, so that the user of the new equipment will be able to continue to use existing software.
Adding a new command requires that a new node be inserted into the parse tree for the language. If the new node is added in parallel with an existing node, for example if a new node GGG were added to the above tree at the same level as AAA and FFF, little problem exists because existing programs will not have known about the node. However, if new nodes would extend the tree, for example if new nodes HHH and III were added below node FFF, existing programs will fail because they no longer specify a complete command. That is, FFF would no longer be a valid command since there is a level below FFF in the tree and the instrument would not know whether to perform the command FFF:HHH or FFF:III. Furthermore, there is no way to plan in advance for this occurrence, since all possible future enhancements would have to be known, and the user would have to enter many useless programming statements to allow for the future enhancements.
Another problem arises if the language needs to be restructured by adding a new level of a tree between existing levels. For example in the above tree, if a new level XXX needs to be added between the AAA level and the BBB, CCC level, the following tree would result: ##STR2## which would not be compatible with existing software. Some commands in existing programs, written for the original language of the instrument, would not have a mnemonic at each level of the new tree, and therefore would be invalid commands.
Because all levels of a parse tree must be specified in a command, it becomes tedious for a user to enter frequently used commands in the instrument. The instrument would be much easier to use if these frequently used commands could be shortened, provided that no confusion is created with the shortening. While a completely new, shorter, command could be placed in the tree for this purpose, this would increase the total number of commands in the instrument thus increasing its overall complexity--a better solution would be to allow existing commands to be entered in a shortened form.
There is need in the art, then, for a method of extending a hierarchical programming language by extending existing commands while providing for compatibility with the existing software already written for the language. Another need in the art is for a method of extending a hierarchical language that allows adding a new level of commands. There is a further need for a method of interpreting a hierarchical programming language that allows frequently used commands to be entered using a shorter form that is more user friendly.